package oom;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xu on 2021/12/5.
 */
public class HeepOOM {

    /**
     * -Xmx20m -Xms20m
     * @param args
     */
    public static void main(String[] args) {

        List list = new ArrayList<>();
        while (true){
            Byte[] obj = new Byte[1024];
            list.add(obj);
            System.out.println(list.size());
        }
    }
}
